<?php
namespace app\api\controller;



use think\Config;
use think\facade\Request;

class Index extends Common
{
    public function __construct()
    {
        parent::__construct();


    }

    /**
     * 加密
     * @return \think\response\Json
     */
    public function encryption()
    {
        $data= array();
        $data['time']=time();
        $tokendata = array();
        $tokendata['implement']=config('app.appstart');
        $tokendata['Complete']=config('app.append');
        $token=$this->dexonApiEncryption($tokendata);
        return json($data)->code(200)->header(['dxtoken' =>$token]);
    }

    /**
     * 解密
     * @return mixed
     */
    public function decrypt(){
        $sign= input('get.sign');
        return $this->dexonApiDecrypt($sign)['msg'];
    }
}
